﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Tour.BLL;
using Tour.DAL;


public partial class Controls_Tourist_SearchTour : VST.Controls.BaseLCGUserControl
{
    public int? ParentId { get; set; }
    public bool? IsVisible { get; set; }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
        }
    }

    void LoadData()
    {
        if (DropDownList1.SelectedValue.Equals("1"))
        {
            ParentId = int.Parse(GetLocaleResourceString("Module.Home.TourQuocTeID "));
            List<TblTourTypeEntity> ls = TblTourTypeManager.CreateInstant().SelectTblTourTypeBy(null, ParentId, WorkingLanguage, "", IsVisible, "Id", "DESC");
            ddlTourType.DataSource = ls;
            ddlTourType.DataTextField = "Name";
            ddlTourType.DataValueField = "Id";
            ddlTourType.DataBind();
        }
        if (DropDownList1.SelectedValue.Equals("0"))
        {
            ParentId = int.Parse(GetLocaleResourceString("Module.Home.TourNoiDiaID"));
            List<TblTourTypeEntity> ls = TblTourTypeManager.CreateInstant().SelectTblTourTypeBy(null, ParentId, WorkingLanguage, "", IsVisible, "Id", "DESC");
            ddlTourType.DataSource = ls;
            ddlTourType.DataTextField = "Name";
            ddlTourType.DataValueField = "Id";
            ddlTourType.DataBind();
        }
    }
    protected void btnReser_Click(object sender, EventArgs e)
    {

    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        LoadData();
    }
}
